<!-- <script lang="ts" setup>

// const props = defineProps(['navData'])
</script> -->
<script>

export default {
  name: 'MenuNav',
  props: {
    navData: {
      type: Array,
      default: function () {
        return []
      }
    }
  },
  data () {
    return {
    }
  }
}

</script>
<template v-for="(item, index) in navData" :key="index">
  <!--有子菜单-->
  <el-sub-menu :index="item.path" v-if="item.children.length !== undefined && item.children.length > 0">
    <template #title>
      <p>有子菜单</p>
      <span>{{ item }} </span>
    </template>
    <!-- <MenuNav :navData="item.children"></MenuNav> -->
  </el-sub-menu>
  <!--没有子菜单-->
  <el-menu-item v-else :index="item.path">
    <p>没有子菜单</p>
    <template #title>{{ item }}</template>
  </el-menu-item>
</template>


